//
//  XZWeatherTypeTool.m
//  生活小助手
//	weather_id = {
//fa = 02,
//fb = 04
//}
//  Created by MAC－ME on 14-8-9.
//  Copyright (c) 2014年 lxz. All rights reserved.
//

#import "XZWeatherIcon.h"

@implementation XZWeatherIcon
+ (UIImage *)weatherIconWithWeatherId:(NSDictionary *)dict
{
    __block  NSString *icon = nil;
    [dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
        
        NSString *f = (NSString *)obj;
        NSInteger fI = [f integerValue];
        switch (fI) {
            case 00:
                icon = @"fine";break;
            case 01:
                icon = @"cloud"; break;
            case 02:
                icon = @"overcast"; break;
            case 03:
                icon = @"smallrain"; break;
            case 04:
                icon = @"thunder"; break;
            case 05:
                icon = @"thunder"; break;
            case 06:
                icon = @"rainsnow"; break;
            case 07:
                icon = @"smallrain"; break;
            case 8:
                icon = @"middlerain"; break;
            case 9:
                icon = @"bigrain"; break;
            case 10:
                icon = @"rainstorm"; break;
            case 11:
                icon = @"bigrainstorm"; break;
            case 12:
                icon = @"bigrainstorm"; break;
            case 13:
                icon = @"smallsnow"; break;
            case 14:
                icon = @"middlesnow"; break;
            case 15:
                icon = @"middlesnow";break;
            case 16:
                icon = @"bigsnow";break;
            case 17:
                icon = @"snowstorm";break;
            case 18:
                icon = @"fog";break;
            case 19:
                icon = @"smallrain";break;
            case 20:
                icon = @"sand";break;
            case 21:
                icon = @"middlerain";break;
            case 22:
                icon = @"middlerain";break;
            case 23:
                icon = @"bigrain";break;
            case 24:
                icon = @"bigrain";break;
            case 25:
                icon = @"rainstorm";break;
            case 26:
                icon = @"middlesnow";break;
            case 27:
                icon = @"middlesnow";break;
            case 28:
                icon = @"bigsnow";break;
            case 29:
                icon = @"sand";break;
            case 30:
                icon = @"sand";break;
            case 31:
                icon = @"sand";break;
            case 53:
                icon = @"haze";break;
            default:
                break;
        }
        
        if (icon) {
            *stop = YES;
        }
    }];
    NSLog(@"天气查询的图片：== ",icon);
    return [UIImage imageNamed:icon];
}
@end
